{% for concept in search_results %} {# loop through the hits #}
<div class="concept-hit">
<div class="concept-headers">
  {% spaceless %}
    {% if concept.foundBy %} {# hit has been found through an alternative label #}
    <span class="search-parameter-highlight"><span class="prefLabel propertylabel">{{ concept.foundBy }}</span>
    {% if concept.ExVocab is defined %}
    <span class="prefLabel conceptlabel redirected-vocab-id"> @{{ concept.ExVocab }}</span>{% endif %}
  <br />&nbsp;&nbsp;&#8627; <a class="propertyvaluelabel" href="{{ concept.uri | link_url(concept.vocab,lang) }}">{{ concept.label }}</a></span>
    {% else %}
    <span class="prefLabel search-parameter-highlight{% if lang_count is not defined and rest != 1 %} propertylabel-pink">{{ concept.label }}</span>{% else %}"></span>
    <a class="conceptlabel" href="{{ concept.uri | link_url(concept.vocab,lang) }}">{{ concept.label }}</a>
    {% endif %}
    {% if concept.vocab != vocab_id and concept.vocab != "" %}<span class="conceptlabel redirected-vocab-id"> @{{ concept.vocab }}</span>{% endif %}
    {% endif %}
  {% endspaceless %}
  {% set typetrans = concept.type %}
  <span class="conceptType propertyvalue concept-type-span" title="{{ typetrans }}">{% if typetrans != null %}{{ typetrans|trans }}{% endif %}</span>
</div>
  	<table class="concept-properties search-results-property-table">
    {% if not uri_parts %} {# uri_parts is only present on the search page where we do not want the hierarchy view #}
      <tr><td ><span class="propertyvaluelabel urilabel">{% trans %}Hierarchy{% endtrans %}:</span><span class="mouseover-help-icon" title="{% trans %}The hierarchy display shows how the concept fits into a wider context through its superordinate concepts.{% endtrans %}"></span></td>
      <td><div id="hierarchy-tree" class="hierarchy-container"></div></td></tr>
    {% endif %}
  	{% for propertyType in concept.properties %} {# loop through concept property types #}
      {% for property in propertyType %} {# looping the actual propertyDAO objects #}
        {% if loop.first %}<tr>
        {% set proptrans = property.type %}
        {% set prophelp = property.type ~ '_help' %}
          <td><span class="propertyvaluelabel" >{{ proptrans|trans }}</span><span class="mouseover-help-icon" title="{{ prophelp|trans }}"></span></td><td class="{{ proptrans|replace({':': ""}) }}"><ul>{# the replace removes the : character from the css classname as those aren't allowed in css  #}{% endif %}
        {% if property.uri %}
        <li>
          {% if property.type == 'skos:narrower' %}
            <a class="propertyvalue" href="{{ property.uri | link_url(concept.vocab,lang) }}">{{ property.value }}</a>
            {% if property.SubMembers %}<div class="subvalue"> {# if property is a group concept that has sub properties #}
              {% for sub_member in property.SubMembers %}
                <a class="propertyvalue" href="{{ sub_member.uri | link_url(concept.vocab,lang) }}">{{ sub_member.value }}</a><br />
              {% endfor %}
              </div>
            {% endif %}
          {% else %}
            {% if property.exvocab != property.vocab %} {# if the property is located in a another vocabulary #}
              <a class="propertyvalue" href="{{ property.uri | link_url(property.exvocab,property.lang) }}">{{ property.value }}</a>
              {% if property.exvocab %} @ {{ property.exvocab }} {% endif %}
            {% else %}
              <a class="propertyvalue" href="{{ property.uri | link_url(property.vocab,lang) }}">{{ property.value }}</a>
            {% endif %}
            {% if property.lang != lang %} ({{ property.lang }}){% endif %} </span>       
          {% endif %}
        {% else %} {# if no uri has been set eg. alternative labels as properties #}
          {% set propval = property.value %}
            <li><h4>{{ propval|trans }}</h4>
        {% endif %}</li>
        {% if loop.last %}</ul></td></tr>{% endif %}
      {% endfor %}
    {% endfor %}
    {% if concept.ForeignLabels %}<tr><td><span class="propertyvaluelabel">{% trans %}onki:prefLabel{% endtrans %}</span><span class="mouseover-help-icon" title="{{ 'foreignhelp'|trans }}"></span></td><td>
      <ul>{% for lang,label in concept.ForeignLabels %}
        <li><h4>{{ label }} ({{ lang }})</h4></li>
      {% endfor %}</ul></td></tr>
    {% endif %}
    <tr><td><h3>URI:</h3></td>
    <td><input readonly value="{{ concept.uri }}" class="propertyvalue uri-input-box"></td></tr>
    </table>
  <div class="bottomtext">
    <span class="header-text-small-font-nobold download-text">{% trans %}Download this concept in SKOS format:{% endtrans %} 
      <a href="{{ path_fix }}rest/v1/{% if concept.vocab != "" %}{{ concept.vocab }}{% else %}{{ vocab.id }}{% endif %}/data?uri={{ concept.uri|url_encode }}&amp;format=application/rdf%2Bxml">RDF/XML<img src="{{ path_fix }}resource/pics/download.png" alt="&darr;"></a>
    </span>
    <span class="header-text-small-font-nobold download-text">
      <a href="{{ path_fix }}rest/v1/{% if concept.vocab != "" %}{{ concept.vocab }}{% else %}{{ vocab.id }}{% endif %}/data?uri={{ concept.uri|url_encode }}&amp;format=text/turtle">
        TURTLE<img src="{{ path_fix }}resource/pics/download.png" alt="&darr;"></a>
    </span>
  </div>
</div>
{% endfor %}
